ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Bembidion_Base Class Reference

The class describing the base class for beetle objects objects. More...

#include <bembidion_all.h>

Inheritance diagram for Bembidion_Base:
TAnimal TALMaSSObject Bembidion_Adult Bembidion_Egg_List Bembidion_Larvae Bembidion_Pupae

Public Member Functions

 Bembidion_Base (int x, int y, Landscape *L, Bembidion_Population_Manager *BPM)
 Constructor. More...
 
void ReInit (int x, int y, Landscape *L, Bembidion_Population_Manager *BPM)
 ReInit for object pool. More...
 
virtual void BeginStep ()
 BeginStep - empty. More...
 
virtual void Step ()
 Step - empty. More...
 
virtual void EndStep ()
 EndStep - empty. More...
 
virtual void st_Die ()
 Common state Die. More...
 
void CopyMyself (int a_beetle)
 For experimental purposes. More...
 
void CopyMyselfB (int a_beetle)
 For experimental purposes. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Public Attributes

TTypesOfBeetleState CurrentBState
 Current behavioural state. More...
 
Bembidion_Population_Managerm_OurPopulation
 Pointer to the population manager. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Detailed Description

The class describing the base class for beetle objects objects.

Constructor & Destructor Documentation

◆ Bembidion_Base()

Bembidion_Base::Bembidion_Base ( int  x,
int  y,
Landscape L,
Bembidion_Population_Manager BPM 
)

Constructor.

207  : TAnimal( x, y, L ) {
208  m_OurPopulation = BPM;
210 }
@ tobs_Initiation
Definition: bembidion_all.h:35
TTypesOfBeetleState CurrentBState
Current behavioural state.
Definition: bembidion_all.h:159
Bembidion_Population_Manager * m_OurPopulation
Pointer to the population manager.
Definition: bembidion_all.h:161
TAnimal(int x, int y, Landscape *L)
Definition: PopulationManager.cpp:1367

References CurrentBState, m_OurPopulation, and tobs_Initiation.

Member Function Documentation

◆ BeginStep()

virtual void Bembidion_Base::BeginStep ( void  )
inlinevirtual

BeginStep - empty.

Reimplemented from TAnimal.

Reimplemented in Bembidion_Adult, Bembidion_Pupae, Bembidion_Larvae, and Bembidion_Egg_List.

150 {}

◆ CopyMyself()

void Bembidion_Base::CopyMyself ( int  a_beetle)

For experimental purposes.

Used for experimental manipulation of the population. This method clones a beetle a_beetles times at the same location as the original.

241 {
242  struct_Bembidion * BS;
243  BS = new struct_Bembidion;
244  BS->x = m_Location_x;
245  BS->y = m_Location_y;
246  BS->L = m_OurLandscape;
247  BS->BPM = m_OurPopulation;
248  m_OurPopulation->CreateObjects(a_beetle,this,NULL,BS,1);
249  delete BS;
250 }
void CreateObjects(int ob_type, TAnimal *pvo, void *null, struct_Bembidion *data, int number)
Method to add beetles to the population.
Definition: Bembidion_all.cpp:2942
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
A data class for Bembidion data.
Definition: bembidion_all.h:114
int x
Definition: bembidion_all.h:117
Landscape * L
Definition: bembidion_all.h:119
int y
Definition: bembidion_all.h:118
Bembidion_Population_Manager * BPM
Definition: bembidion_all.h:120

References struct_Bembidion::BPM, Bembidion_Population_Manager::CreateObjects(), struct_Bembidion::L, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, m_OurPopulation, struct_Bembidion::x, and struct_Bembidion::y.

Referenced by Bembidion_Population_Manager::Catastrophe().

◆ CopyMyselfB()

void Bembidion_Base::CopyMyselfB ( int  a_beetle)

For experimental purposes.

Used for experimental manipulation of the population. This method clones a beetle a_beetles times within +/- 32m of the individuals location using wrap around.

259 {
260  struct_Bembidion * BS;
261  for (int i=0; i<a_beetle; i++) {
262  BS = new struct_Bembidion;
263  int coord = ((m_Location_x + (random(64)-32))+m_OurPopulation->SimW) % m_OurPopulation->SimW ;
264  BS->x = coord;
265  coord = ((m_Location_y + (random(64)-32))+m_OurPopulation->SimH) % m_OurPopulation->SimH ;
266  BS->y = coord;
267  BS->L = m_OurLandscape;
268  BS->BPM = m_OurPopulation;
269  m_OurPopulation->CreateObjects(1,this,NULL,BS,1);
270  delete BS;
271  }
272 
273 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
int SimH
Definition: PopulationManager.h:511
int SimW
Definition: PopulationManager.h:511

References struct_Bembidion::BPM, Bembidion_Population_Manager::CreateObjects(), struct_Bembidion::L, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, m_OurPopulation, random(), Population_Manager::SimH, Population_Manager::SimW, struct_Bembidion::x, and struct_Bembidion::y.

◆ EndStep()

virtual void Bembidion_Base::EndStep ( void  )
inlinevirtual

EndStep - empty.

Reimplemented from TAnimal.

Reimplemented in Bembidion_Adult.

154 {}

◆ ReInit()

void Bembidion_Base::ReInit ( int  x,
int  y,
Landscape L,
Bembidion_Population_Manager BPM 
)

ReInit for object pool.

213  {
214  ReinitialiseObject( x, y, L );
215  m_OurPopulation = BPM;
217 }
virtual void ReinitialiseObject()
Used to re-use an object - must be implemented in descendent classes.
Definition: PopulationManager.h:143

References CurrentBState, m_OurPopulation, TALMaSSObject::ReinitialiseObject(), and tobs_Initiation.

Referenced by Bembidion_Larvae::ReInit(), Bembidion_Pupae::ReInit(), and Bembidion_Adult::ReInit().

◆ st_Die()

void Bembidion_Base::st_Die ( )
virtual

Common state Die.

Do the housekeeping necessary to die as an object in the system.

225 {
227  m_CurrentStateNo=-1;
228  m_StepDone=true;
229 #ifdef __LAMBDA_RECORD
231 #endif
232 }
@ tobs_Destroy
Definition: bembidion_all.h:55
void LamdaDeath(int x, int y)
Definition: PopulationManager.h:599
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116

References CurrentBState, Population_Manager::LamdaDeath(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, m_OurPopulation, TALMaSSObject::m_StepDone, and tobs_Destroy.

Referenced by Bembidion_Adult::EndStep(), Bembidion_Adult::InternalPesticideHandlingAndResponse(), Bembidion_Larvae::Step(), Bembidion_Pupae::Step(), and Bembidion_Adult::Step().

◆ Step()

virtual void Bembidion_Base::Step ( void  )
inlinevirtual

Step - empty.

Reimplemented from TAnimal.

Reimplemented in Bembidion_Adult, Bembidion_Pupae, Bembidion_Larvae, and Bembidion_Egg_List.

152 {}

Member Data Documentation

◆ CurrentBState

◆ m_OurPopulation


The documentation for this class was generated from the following files: